package au.com.evoCoach.controller;

import java.util.Map;

import javax.servlet.http.HttpSession;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

import au.com.evoCoach.domain.Coach;
import au.com.evoCoach.service.TeamService;

@Controller
public class TradeMaint {
	
	private TeamService teamService;
	
	@Autowired
	public TradeMaint(TeamService teamService) {
		this.teamService = teamService;
	}
	
	@RequestMapping("/tradeMaint.action")
	public String execute(Map model, HttpSession session) throws Exception {
		
		Coach coach = (Coach) session.getAttribute("loggedInCoach");
		model.put("teamDetails", teamService.getTeamDetails(coach.getTeam(), true));
		model.put("coach", coach);
		
		return "tradeMaint";
	}	

}

